home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 132_01 / cwriter.c < prev    next >
Text File  |  1985-08-19  |  1KB  |  85 lines

  1.     #INCLUDE    GRAPH.H
  2.     #ASM
  3.     ORG    4000H
  4.     LIST    -L
  5.     #ENDASM
  6.     #INCLUDE    PRELUDE
  7. /*
  8.     allocate list storage
  9. */
  10. int    master[NMASTER];
  11. int    lpage0[NPAGE],lpage1[NPAGE];
  12. /*
  13.     Debugging pointers
  14. */
  15. int    *gscan,*gscan1,*gxleft,*gxright,*gyupper,*gylower;
  16. int    *gxm,*gym;
  17. joytest()
  18. {
  19. int    *scrn,n,xl,yl,*object;
  20. int    xr,yr;
  21. int    *mscan;
  22. int    toggle;    /* a toggle for page flipping */
  23. char    *plx,*ply;
  24. char    *prx,*pry;
  25.     plx = JOYLX;
  26.     ply = JOYLY;
  27.     prx = JOYRX;
  28.     pry = JOYRY;
  29.  
  30. *flop = 20000;    /* clock interrupt counter = 2 */
  31. toggle = 0;
  32. xr = 1;
  33. xl =1;
  34. yl = 1;
  35. yr = 1;
  36. init();        /* set up the graphics lists */
  37. while(yl < 60) {
  38.     joystick();    /* get joystick co-ordinates    */
  39. xl = *plx;
  40. yl = *ply;
  41. xr = *prx;
  42. yr = *pry;
  43. mscan=master;
  44.     mscan[X]=xl;
  45.     mscan[Y]=yl;
  46.     mscan[FLAGS]=NULL;
  47.     mscan=mscan[FORWARD];
  48.     mscan[X]=xr;
  49.     mscan[Y]=yr;
  50.     mscan[FLAGS]=NULL;
  51.     if(toggle) {
  52.         cwriter(master,lpage0,PAGE0);
  53.         toggle = 0;
  54.         setscrn(PAGE0);
  55.     }
  56.     else {
  57.         cwriter(master,lpage1,PAGE1);
  58.         toggle = 1;
  59.         setscrn(PAGE1);
  60.     }
  61. }
  62. }
  63. cwriter(mlist,page,screen)
  64. int    *mlist,*page,*screen;
  65. {
  66.  
  67.  
  68.     pass0(mlist,page,screen);
  69.     pass1(mlist,page,screen);
  70.     pass2(mlist,page,screen);
  71. }
  72.     #INCLUDE    cwrtini.c
  73.     #INCLUDE    pass0.c
  74.     #INCLUDE    pass1.c
  75.     #INCLUDE    pass2.c
  76.     #INCLUDE    LIB
  77.     #INCLUDE    RUN
  78.     #ASM
  79.     LIST    *
  80.     #ENDASM
  81. m;
  82.     plist[X]      = x;
  83.     plist[Y]      = y;
  84.     plist[FLAGS]  = flags;
  85.     plist[OBJ